package com.ruoyi.communication.controller;

import com.ruoyi.communication.service.ModbusService;
import com.serotonin.modbus4j.exception.ModbusTransportException;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
* @description: TODO
* @author dai
* @date 2022/12/14 20:48
* @version 1.0
*/

@RestController
public class GatewayDataController {

    @Resource
    private ModbusService modbusService;

    @RequestMapping("/gateway")
    public void getData() throws ModbusTransportException {
        String ip = "192.168.2.100";
        int offset = 0;
        int numberOfRegister = 0;
        modbusService.readInputStatus(ip, offset, numberOfRegister);
    }
}
